﻿using QFramework;
using System;
using System.Collections.Generic;

public interface IHK_QuesDataModel : IModel
{
    // 初始化数据
    BindableProperty<HK_QuizData> QuizData { get; }

    BindableProperty<int> Single_Num { get; }
    BindableProperty<int> Multiple_Num { get; }
    BindableProperty<int> TrueFalse_Num { get; }
    BindableProperty<int> Blank_Num { get; }
    BindableProperty<int> ShortAnswer_Num { get; }
    BindableProperty<int> TotalScore { get; }
}

public class HK_QuesDataModel : AbstractModel, IHK_QuesDataModel
{
    protected override void OnInit()
    {

    }

    public BindableProperty<HK_QuizData> QuizData { get; } = new BindableProperty<HK_QuizData>();

    public BindableProperty<int> Single_Num { get; } = new BindableProperty<int>();
    public BindableProperty<int> Multiple_Num { get; } = new BindableProperty<int>();
    public BindableProperty<int> TrueFalse_Num { get; } = new BindableProperty<int>();
    public BindableProperty<int> Blank_Num { get; } = new BindableProperty<int>();
    public BindableProperty<int> ShortAnswer_Num { get; } = new BindableProperty<int>();

    public BindableProperty<int> TotalScore { get; } = new BindableProperty<int>();
}

// 试卷整体数据结构
[Serializable]
public class HK_QuizData
{
    public int SingleChoice_Score;
    public int MultipleChoice_Score;
    public int TrueFalse_Score;
    public int Blank_Score;
    public int ShortAnswer_Score;
    public List<HK_SingleChoiceData> SingleChoice_List;
    public List<HK_MultipleChoiceData> MultipleChoice_List;
    public List<HK_TrueFalseData> TrueFalse_List;
    public List<HK_BlankData> Blank_List;
    public List<HK_ShortAnswerData> ShortAnswer_List;
}

// 单选题数据结构
[Serializable]
public class HK_SingleChoiceData
{
    // 题目
    public string QuesName;
    // 答案选择
    public string[] Options;
    // 答案
    public string Answer;
    // 答案解析
    public string Analysis;
}

// 多选题数据结构
[Serializable]
public class HK_MultipleChoiceData
{
    // 题目
    public string QuesName;
    // 答案选择
    public string[] Options;
    // 答案
    public string Answer;
    // 答案解析
    public string Analysis;
}

// 判断题数据结构
[Serializable]
public class HK_TrueFalseData
{
    // 题目
    public string QuesName;
    // 答案ID
    public int AnswerID;
    // 答案解析
    public string Analysis;
}

// 填空题数据结构
[Serializable]
public class HK_BlankData
{
    // 题目
    public string QuesName;
    // 答案列表
    public List<string> Answer_List;
    // 答案解析
    public string Analysis;
}

// 简答题数据结构
[Serializable]
public class HK_ShortAnswerData
{
    // 题目 
    public string QuesName;
    // 答案
    public string Answer;
    // 答案解析
    public string Analysis;
}